package com.gs.weather.dao;

import com.gs.weather.dao.mapper.DisasterSubtypeStrengthMapper;
import com.gs.weather.entity.DisasterSubtypeStrength;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created with IntelliJ IDEA.
 * User: Legolas
 * Date: 2017/9/21 0021
 */
@Repository
public class DisasterSubtypeStrengthDao {
    Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    DisasterSubtypeStrengthMapper mapper;

    //添加灾害强度
    public void addStrength(DisasterSubtypeStrength disasterSubtypeStrength) {
        try {
            mapper.addStrength(disasterSubtypeStrength);
        } catch (Exception e) {
            logger.info("addStrength失败->{}", e.getMessage());
        }
    }

    //更新灾害强度
    public void updateStrength(DisasterSubtypeStrength disasterSubtypeStrength) {
        try {
            mapper.updateStrength(disasterSubtypeStrength);
        } catch (Exception e) {
            logger.info("updateStrength失败->{}", e.getMessage());
        }
    }

    //删除灾害强度
    public void deleteStrength(int id) {
        try {
            mapper.deleteStrength(id);
        } catch (Exception e) {
            logger.info("deleteStrength失败->{}", e.getMessage());
        }
    }

}
